package com.neuedu.his.controller;

import com.neuedu.his.po.Testapply;
import com.neuedu.his.service.TestapplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/testapply")
public class TestApplyController {

    @Autowired
    private TestapplyService testapplyService;

    @PostMapping("/add")
    public boolean add(@RequestBody Testapply testapply) {
        return testapplyService.save(testapply);
    }

    @PostMapping("/delete")
    public boolean delete(@RequestBody Map<String, Integer> params) {
        Integer id = params.get("id");
        return testapplyService.removeById(id);
    }

    @GetMapping("/list")
    public List<Testapply> list() {
        return testapplyService.list();
    }
}